package com.yyplatform.admin.platform.log.entity;

import java.util.Date;

import com.yyplatform.admin.infra.model.entity.BaseEntity;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * Created on 2024-09-13
 */

@Entity
@Getter
@Setter
@ToString
@Table(name = "sys_operation_log")
public class SysOperationLogEntity extends BaseEntity {


    @Column(name = "user_id", nullable = false, columnDefinition = "bigint(20) comment '用户ID'")
    private Long userId;

    @Column(name = "username", nullable = false, columnDefinition = " varchar(50) comment '用户名' ")
    private String username;

    @Column(name = "real_name", columnDefinition = " varchar(50) comment '用户真实姓名' ")
    private String realName;


    @Column(name = "business_type", nullable = false, columnDefinition = " varchar(50) comment '业务类型' ")
    private String businessType;

    @Column(name = "business_name", nullable = false, columnDefinition = " varchar(50) comment '业务名称' ")
    private String businessName;

    @Column(name = "java_method", nullable = false, columnDefinition = " varchar(50) comment 'java方法' ")
    private String javaMethod;

    @Column(name = "uri", nullable = false, columnDefinition = " varchar(200) comment '请求地址' ")
    private String uri;

    @Column(name = "method", nullable = false, columnDefinition = " varchar(50) comment '请求方式' ")
    private String method;

    @Column(name = "request_time", nullable = false, columnDefinition = " datetime comment '请求时间' ")
    private Date requestTime;

    @Column(name = "user_agent", nullable = false, columnDefinition = " varchar(200) comment '请求UA' ")
    private String userAgent;

    @Column(name = "ip", nullable = false, columnDefinition = " varchar(50) comment '请求IP' ")
    private String ip;

    @Column(name = "location", nullable = false, columnDefinition = " varchar(200) comment '请求地址' ")
    private String location;


    @Column(name = "browser", nullable = false, columnDefinition = " varchar(50) comment '浏览器' ")
    private String browser;

    @Column(name = "os", nullable = false, columnDefinition = " varchar(50) comment '操作系统'")
    private String os;


    @Column(name = "param_json", nullable = false, columnDefinition = " text comment '请求参数JSON' ")
    private String paramJson;

    @Column(name = "result_json", nullable = false, columnDefinition = " text comment '返回结果JSON' ")
    private String resultJson;

    @Column(name = "cost", nullable = false, columnDefinition = " int(11) comment '耗时单位ms' ")
    private int cost;

    @Column(name = "error_msg", nullable = false, columnDefinition = " text comment '异常信息' ")
    private String errorMsg;

    @Column(name = "error_code", nullable = false, columnDefinition = " int(11) comment '异常code' ")
    private int errorCode;


}
